package com.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String Hello(){
        /*逻辑视图*/
        return "success";
    }

    @RequestMapping("/str")
    @ResponseBody
    public String Str(){
        return "success";
    }

    @RequestMapping("/Exception")
    @ResponseBody
    public String json(){
        try {
            int i = 10/0;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "ok";
    }
}
